<template>
	<view>
		<view>
			<view class="box-bg">
				<uni-nav-bar height="5vh" title="课程详情" />
			</view>
		</view>
		<view class="classDetail-image">
			<image :src="classDetail.imgs"></image>
		</view>
		<view >
			<uni-list-item  title="课程id" :rightText="classDetail.id" />
			<uni-list-item title="课程名称" :rightText="classDetail.name" />
			<uni-list-item title="代课老师" :rightText="classDetail.tname" />
			<uni-list-item title="课程标签" :rightText="classDetail.tags" />
			<uni-list-item title="课程已选人数" :rightText="classDetail.pnum" />
			<uni-list-item title="课程上限人数" :rightText="classDetail.pmax" />
			<uni-list-item title="课程开始时间" :rightText="classDetail.startTime" />
			<uni-list-item title="课程结束时间" :rightText="classDetail.endTime" />
			<uni-list-item title="教室" :rightText="classDetail.roomName" />
		</view>
	</view>
</template>

<script>
import { getClassByClassId } from '../../api/class';
import { baseUrl } from '../../config';

	export default{
		data(){
			return{
				classDetail:{}
			}
		},
		methods:{
			
		},
		onLoad(options) {
			console.log(options.id);
			getClassByClassId(options.id).then(res=>{
				res.data.data.imgs=baseUrl+"/common/download?name="+res.data.data.imgs
				this.classDetail=res.data.data
			})
		}
	}
</script>

<style>
	.classDetail-image{
		width: 100%;
		height: 30vh;
	}
	.classDetail-image image{
		width: 100%;
		height: 100%;
	}
	
</style>